from copy import deepcopy
#浅度拷贝
a=[12,34,12,54,[43,'tom']]
b=a.copy ()
a.append(78)
a[4].append(78)
a.insert(4,56)
print(f'{a}')
print(f'{b}')

#深度拷贝
import copy
c=[1,2,3,4,5,[12,23]]
d=copy.deepcopy(c)
c.append(6)
d[5].append('tom')
print(c)
print(d)

#切片
#求列表里所有偶数的和
a1=[12,34,23,46,34,32]
sum=0
for a2 in a1:
    if (a2%2) ==0 :
        sum+=a2
print(sum)
